<?php
require 'BinarySearchTree.php';

$binarySearchTree = new BinarySearchTree();
$binarySearchTree->add(45);
$binarySearchTree->add(30);
$binarySearchTree->add(55);
$binarySearchTree->add(25);
$binarySearchTree->add(35);
$binarySearchTree->add(50);
$binarySearchTree->add(65);
$binarySearchTree->add(15);
$binarySearchTree->add(27);
$binarySearchTree->add(31);
$binarySearchTree->add(48);
$binarySearchTree->add(60);
$binarySearchTree->add(68);
//下面是预期想要的结果
/**
 *                     45
 *           /                   \
 *          30                   55
 *        /      \              /    \
 *      25       35         50       65
 *     /  \     /          /  \     /   \
 *   15   27  31         48       60     68
 *
 */
$binarySearchTree->preTraversal();//前序遍历

$binarySearchTree->tierTraversalByLinkedList();//层序遍历


